<%= form_for @category, url: categories_path, :html => { :class => "form-horizontal category" } do |f| %>

  <% if @category.errors.any? %>
    <div id="error_expl" class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title"><%= pluralize(@category.errors.count, "error") %> prohibited this category from being saved:</h3>
      </div>
      <div class="panel-body">
        <ul>
        <% @category.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  <% end %>

  <div class="form-group">
    <%= f.label :name, :class => 'control-label col-lg-2' %>
    <div class="col-lg-10">
      <%= f.text_field :name, :class => 'form-control' %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :type, :class => 'control-label col-lg-2' %>
    <div class="col-lg-10">
      <%= f.text_field :type, :class => 'form-control' %>
    </div>
  </div>

  <div class="form-group">
    <div class="col-lg-offset-2 col-lg-10">
      <%= f.submit nil, :class => 'btn btn-primary' %>
      <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                categories_path, :class => 'btn btn-default' %>
    </div>
  </div>

<% end %>
